{
  "properties" : { },
  "id" : "943f08b48d094c819414d3ddaa6b5f27",
  "script" : null,
  "groupId" : "0261e43407c04ca8a513406f4ce13134",
  "name" : "liugl.html",
  "createTime" : null,
  "updateTime" : 1744482309881,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "可辉",
  "path" : "liugl.html"
}
================================
<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>|</title>
    <link rel="stylesheet" href="/plugs/layui/css/layui.css" />
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
      html, body {
        height: 100%
      }
      .layui-table .layui-form-select .layui-input{
        height: 28px
      }
      .ws-docs-icon>div {
        display: inline-block; vertical-align: middle; width: 15.9%; height: 105px; line-height: 25px; padding: 20px 0; margin-right: -1px; margin-bottom: -1px; border: 1px solid #e2e2e2; font-size: 14px; text-align: center; color: #777; cursor: pointer; transition: all .3s; -webkit-transition: all .3s;
      }
    </style>
</head>
<body class="layui-padding-2">
  <table class="layui-hide" id="ID-table"></table>

  <script type="text/html" id="TPL-table-toolbar">
    <div class="layui-btn-container">
      <button type="button" class="layui-btn layui-btn-sm" id="deploy" lay-options="{ accept: 'file', exts: 'xml' }">
        <i class="layui-icon layui-icon-upload"></i> 
        部署定义流程
      </button>
      <button type="button" class="layui-btn layui-btn-sm layui-bg-red" lay-event="removeAll">
          删除所有部署
      </button>
      <button type="button" class="layui-btn layui-btn-sm" lay-event="openBpmnEdit">
          流程工具
      </button>
    </div>
  </script>
  <script type="text/html" id="TPL-table-tools">
    <div class="layui-btn-container">
      <a class="layui-btn layui-btn-warm layui-btn-xs" lay-event="examine">查看</a>
      <a class="layui-btn layui-btn-xs" lay-event="examine_edit">编辑</a>
    </div>
  </script>

  <script src="/plugs/layui/layui.js"></script>
  <script type="text/javascript">
    layui.use(function(){
      var table = layui.table;
      var layer = layui.layer;
      var form = layui.form;
      var upload = layui.upload;
      var $ = layui.jquery;
      
      var removeObj = function(tableObj, postData) {
        $.ajax({
          url: '/api/workflow/deploy/delete_all', type: 'DELETE', data: postData, success: function(res){
            layer.closeAll();
            if(res.code === 200){
              layer.msg(res.msg, { icon: 1 });
              table.reload(tableId);
            } else {
              layer.alert(res.msg, { icon: 5});
            }
          }
          ,error: function(res, msg){layer.msg('error');}
        });
      }

      var tableId = 'ID-table';

      var inst = table.render({
        elem: '#'+tableId, toolbar: '#TPL-table-toolbar',
        url: '/api/workflow/processes/definition/query',
        height: 'full', response: {statusCode: 200},
        cols: [[
          {type: 'checkbox', fixed: 'left'},
          {field: 'id', title: '编号'},
          {field: 'name', title: '名称'},
          {field: 'key', title: '检索关联钥匙'},
          {field: 'version', title: '版本'},
          {fixed: "right", title: "操作", align: "center", toolbar: "#TPL-table-tools", width: 180} 
        ]],
        page: false,
        done: function(res, curr, count){
          
        }
      });

      // 表头工具栏工具事件
      table.on('toolbar('+tableId+')', function (obj) {
        if (obj.event === 'removeAll'){
          layer.confirm("真的删除所有？？？？  会导致进行中流程异常", {title: false}, function (index) {
            removeObj(obj);
            layer.close(index);
          });
        } else if(obj.event === 'openBpmnEdit'){
            layer.open({
                type: 2,
                title: false,
                shadeClose: true,
                maxmin: true, //开启最大化最小化按钮
                area: ['98%', '98%'],
                content: "./liugl_edit",
            });
        }
      });
      upload.render({
        elem: '#deploy',
        url: '/api/workflow/deploy/processes',
        accept: 'file', // 普通文件
        done: function(res){
          layer.msg('上传成功');
          table.reload(tableId);
        }
      });
      // 单元格工具事件
      table.on('tool('+ inst.config.id +')', function (obj) {
        var layEvent = obj.event;
        var trData = obj.data;
        if(obj.event === 'examine'){
          layer.photos({
            photos: {
              "start": 0,
              "data": [
                {
                  "alt": "浩瀚宇宙",
                  "src": "/api/workflow/processes/definition.svg?processDefinitionId="+trData.id,
                }
              ]
            },
            footer: false // 是否显示底部栏 --- 2.8.16+
          });
        } else if(obj.event === 'examine_edit'){
          layer.open({
            type: 2,
            title: false,
            shadeClose: true,
            maxmin: true, //开启最大化最小化按钮
            area: ['98%', '98%'],
            content: "./liugl_edit?id="+trData.id,
          });
        }
      });


    });
  </script>
</body>